package com.xframework.gateway;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;

@SpringBootApplication
@EnableDiscoveryClient
@ImportResource(locations = {"classpath:applicationContext.xml"})
@ComponentScan({"com.xframework.gateway", "com.xframework.security.util"})
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

//    @Bean
//    public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
//        return builder.routes()
//                // 配制一个路由,把 http://网关地址:网关端口/demo/ 下的请求路由到 demo-service 微服务中
//                .route(p -> p
//                        .path("/concurrent-test/**") //url匹配
//                        .uri("lb://concurrent-test"))  // 将请求路由到指定目标, lb开头是注册中心中的服务, http/https 开头你懂的
//                .build();
//    }

}
